Skip to content

fix(telemetry): rename isClientApiError to isUserApiError and exclude 400#729

Merged
BYK merged 1 commit intomainfrom
fix/telemetry-400-is-cli-bug
Apr 13, 2026
Merged

fix(telemetry): rename isClientApiError to isUserApiError and exclude 400#729
BYK merged 1 commit intomainfrom
fix/telemetry-400-is-cli-bug

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 13, 2026

Summary

  • Rename isClientApiErrorisUserApiError for clarity
  • Change boundary from >= 400 to > 400, excluding 400 Bad Request
  • 400 Bad Request indicates a CLI bug (malformed API request) per project convention — it should be captured as an exception, not silently dropped
  • 401-499 remain classified as user errors (wrong ID, no access, rate limited) and continue to be recorded as span attributes only

Context

The two capture sites (exceptionWhileRunningCommand in app.ts and withTelemetry in telemetry.ts) had inconsistent 400 handling. The primary site (app.ts) correctly captures 400s, but the secondary safety-net (withTelemetry) was silently swallowing them via isClientApiError. This aligns both sites.

… 400

400 Bad Request indicates a CLI bug (malformed API request the CLI should
never send), not a user error. The previous isClientApiError treated all
4xx uniformly, which would silently swallow 400s if they escaped Stricli.

Rename to isUserApiError for clarity and change the boundary from
>= 400 to > 400, ensuring 400 Bad Request is captured as an exception
while 401-499 continue to be recorded as span attributes only.
@github-actions
Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (cli) Add sentry cli defaults command for persistent settings by BYK in #721

Bug Fixes 🐛

Upgrade

  • Detect npm install method from node_modules path by BYK in #723
  • Add shell option on Windows for .cmd package managers by BYK in #722

Other

  • (dashboard) Remove overly restrictive dataset-display cross-validation by BYK in #720
  • (init) Remove JSON minification that breaks edit-based codemods by betegon in #719
  • (issue) Support share issue URLs by BYK in #718
  • (telemetry) Rename isClientApiError to isUserApiError and exclude 400 by BYK in #729

Internal Changes 🔧

  • Regenerate skill files by github-actions[bot] in ca16b2ff

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-729/

Built to branch gh-pages at 2026-04-13 14:07 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1599 uncovered lines.
❌ Project coverage is 95.33%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    95.35%    95.33%    -0.02%
==========================================
  Files          234       234         —
  Lines        34209     34207        -2
  Branches         0         0         —
==========================================
+ Hits         32618     32608       -10
- Misses        1591      1599        +8
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 68fb933 into main Apr 13, 2026
24 checks passed
@BYK BYK deleted the fix/telemetry-400-is-cli-bug branch April 13, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant